package zuoye;

public class SedQueue {
    private final int MAX=100;
    private String arr[] = new String[MAX];
    private int front=0;
    private int rear=0;

    public void enQueue(String name){
        arr[rear] = name;
        rear++;
    }

    public void delQueue(){
        front++;
    }

    public int length(){
        return rear-front;
    }

    public void clear(){
        front=0;
        rear=0;
    }

    public void display(){
        if(front==rear){
            System.out.println("此表为空");
            return;
        }
        for (int i = front;i<rear;i++){
            System.out.print(arr[i] + "  " );
        }
        System.out.println();
    }
}
